<%@ page pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<c:import url="/inc/header.jsp" />
<c:import url="/inc/menu.jsp" />
<c:import url="/inc/content-begin.jsp" />

<div class="head">
	<div class="info">
		<h1>Lister et rechercher des opérations.</h1>
		<ul class="breadcrumb">
			<li class="active">Recherchez parmis toutes les opérations à partir des critères suivants.</li>
		</ul>
	</div>
</div>
<div class="content">
<c:import url="/inc/alert-ie.jsp" />
<c:import url="/inc/alerts.jsp" />


	<form method="post" action="<c:url value="/private/listeOperation"/>">

		<div class="row-fluid">
			<div class="span6">
				<div class="block">
					<div class="head">
						<h2>Recherche sur le libellé</h2>
						<ul class="buttons">
							<li><a href="#" class="block_toggle"><span
									class="i-arrow-down-3"></span></a></li>
							<li><a href="#" class="block_remove"><span
									class="i-cancel-2"></span></a></li>
						</ul>
					</div>
					<div class="content np">

						<div class="content np">
							<div class="controls-row">
								<div class="span3">Intitulé:</div>
								<div class="span9">
									<input type="text" id="intitule" name="intitule"
										value="${form.intitule}" />
								</div>
							</div>
						</div>

						<c:if test="${ !empty form.erreurs['intitule'] }">
							<div class="content np">
								<div class="controls-row">
									<div class="row-fluid">
										<div class="span12">
											<div class="alert alert-block">
												<strong>Attention: </strong> ${form.erreurs['intitule']}
											</div>
										</div>
									</div>
								</div>
							</div>
						</c:if>

						<div class="content np">
							<div class="controls-row">
								<div class="span3">Batiment:</div>
								<div class="span9">
									<input type="text" id="nomBatiment" name="nomBatiment"
										value="${form.nomBatiment}" />
								</div>
							</div>
						</div>

						<div class="content np">
							<div class="controls-row">
								<div class="span3">Technicien:</div>
								<div class="span9">
									<input type="text" id="technicienOperation"
										name="technicienOperation" value="${form.technicienOperation}" />
								</div>
							</div>
						</div>

						<div class="content np">
							<div class="controls-row">
								<div class="span3">Autorisation:</div>
								<div class="span9">
									<label class="radio inline"> <input type="radio"
										name="autorisation"
										<c:if test="${form.autorisation eq 'AP'}">checked</c:if>
										value="AP">AP
									</label> <label class="radio inline"> <input type="radio"
										name="autorisation"
										<c:if test="${form.autorisation eq 'HAP'}">checked</c:if>
										value="HAP">HAP
									</label> <label class="radio inline"> <input type="radio"
										name="autorisation"
										<c:if test="${form.autorisation eq 'indeterminee'}">checked</c:if>
										value="indeterminee">Indetereminée
									</label>
								</div>
							</div>
						</div>

					</div>

					<div class="footer">
						<div class="side fr">
							<input class="btn btn-primary" type="submit" value="Recherche">
						</div>
					</div>

				</div>
			</div>

			<div class="span6">
				<div class="block">
					<div class="head">
						<h2>Recherche sur le budget</h2>
						<ul class="buttons">
							<li><a href="#" class="block_toggle"><span
									class="i-arrow-down-3"></span></a></li>
							<li><a href="#" class="block_remove"><span
									class="i-cancel-2"></span></a></li>
						</ul>
					</div>



					<div class="content np">
						<div class="controls-row">
							<div class="span3">Montant totale superieur à</div>
							<div class="span9">
								<input readonly type="text" id="sommeTotaleSupOperation"
									name="sommeTotaleSupOperation"
									value="${form.sommeTotaleSupOperation}" /><span
									class="help-inline">Budget Note: les montants sont les
									montants votés.</span>
							</div>
						</div>
					</div>
					<div class="content np">
						<div class="controls-row">
							<div class="span3">Montant totale inferieur à</div>
							<div class="span9">
								<input readonly type="text" id="sommeTotaleInfOperation"
									name="sommeTotaleInfOperation"
									value="${form.sommeTotaleInfOperation}" /><span
									class="help-inline"></span>
							</div>
						</div>
					</div>

					<div class="content np">
						<div class="controls-row">
							<div class="span3">Montant annuel superieur à</div>
							<div class="span9">
								<input readonly type="text" id="sommeAnnuelSupOperation"
									name="sommeAnnuelSupOperation"
									value="${form.sommeAnnuelSupOperation}" /><span
									class="help-inline"></span>
							</div>
						</div>
					</div>

					<div class="content np">
						<div class="controls-row">
							<div class="span3">Montant annuel inferieur:</div>
							<div class="span9">
								<input readonly type="text" id="sommeAnnuelInfOperation"
									name="sommeAnnuelInfOperation"
									value="${form.sommeAnnuelInfOperation}" /><span
									class="help-inline"></span>
							</div>
						</div>
					</div>

					<div class="footer">
						<div class="side fl">Non disponible pour le moment.</div>
						<div class="side fr">
							<input class="btn btn-primary" type="submit" value="Recherche">
						</div>
					</div>

				</div>
			</div>
		</div>

		<div class="row-fluid">
			<div class="span12">
				<div class="block">
					<div class="head">
						<h2>Recherche sur le calendrier</h2>
						<ul class="buttons">
							<li><a href="#" class="block_toggle"><span
									class="i-arrow-down-3"></span></a></li>
							<li><a href="#" class="block_remove"><span
									class="i-cancel-2"></span></a></li>
						</ul>
					</div>
					<div class="content np">
						<div class="controls-row">
							<div class="span3">Chercher seulement:</div>
							<div class="span9">
								<select name="s_example" class="validate[required]"
									name="dateChoix">
									<option value="present"
										<c:if test="${form.dateChoix} == present">checked</c:if>>L'année
										en cours seulement.</option>
									<option value="futur"
										<c:if test="${form.dateChoix} == futur">checked</c:if>>L'année
										en cours et toute les années apres.</option>
									<option value="futur"
										<c:if test="${form.dateChoix} == futur">checked</c:if>>L'année
										en cours et toute les années avant.</option>
									<option value="tout"
										<c:if test="${form.dateChoix} == tout">checked</c:if>>Toute
										les années</option>
								</select>
							</div>
						</div>
					</div>

					<div class="content np">
						<div class="controls-row">
							<div class="span3">Les opérations debuttent après:</div>
							<div class="span9">
								<input readonly type="text" id="dateDebutApres"
									name="dateDebutApres" value="${form.dateDebutApres}" /><span
									class="help-inline">Calendrier (format jj/mm/aaaa ou
									mm/aaaa qui sera equivalent au 15 du mois.)</span>
							</div>
						</div>
					</div>

					<div class="content np">
						<div class="controls-row">
							<div class="span3">Les operations finissent avant:</div>
							<div class="span9">
								<input readonly type="text" id="dateDebutAvant"
									name="dateDebutAvant" value="${form.dateDebutAvant}" /><span
									class="help-inline"></span>
							</div>
						</div>
					</div>

					<div class="content np">
						<div class="controls-row">
							<div class="span3">Les operations finissent après:</div>
							<div class="span9">
								<input readonly type="text" id="dateFinApres"
									name="dateFinApres" value="${form.dateFinApres}" /><span
									class="help-inline"></span>
							</div>
						</div>
					</div>
					<div class="content np">
						<div class="controls-row">
							<div class="span3">Les operations finissent avant:</div>
							<div class="span9">
								<input readonly type="text" id="dateFinAvant"
									name="dateFinAvant" value="${form.dateFinAvant}" /><span
									class="help-inline"></span>
							</div>
						</div>
					</div>

					<div class="footer">
						<div class="side fl">Non disponilbe pour le moment.</div>
						<div class="side fr">
							<input class="btn btn-primary" type="submit" value="Recherche">
						</div>
					</div>

				</div>
			</div>
		</div>
	</form>
</div>

<!-- 
<div>
	<c:forEach items="${listeOperation}" var="op">

		 ${op.libelle.intitule} </br>
		 ${op.libelle.description} </br>
		 ${op.libelle.etat} </br>
		 ${op.libelle.autorisation} </br>
		 ${op.libelle.nomDemandeurOperation} </br>
		 ${op.libelle.nomServiceExecutant} </br>
		 ${op.libelle.nomElu} </br>
		 ${op.libelle.dateDemandeTravaux} </br>
		 ${op.libelle.nomTechnicien} </br>
		 ${op.libelle.nomBatiment} </br>
		 ${op.libelle.refCadastralBatiment} </br>
		 ${op.libelle.APexistante} </br>
		 ${op.libelle.complementAP} </br>
		 ${op.libelle.autorisationACreer}</br>
		 ${op.libelle.observationsOperation} </br>
		 ${op.libelle.observationBatiment} </br>
		</br>
		</br>
		</br>
	</c:forEach>
</div> -->

<div class="row-fluid">
	<div class="span12">
		<div class="block">
			<div class="head">
				<h2>Liste des opérations:</h2>
				<ul class="buttons">
					<li><a href="#" class="block_toggle"><span
							class="i-arrow-down-3"></span></a></li>
				</ul>
			</div>
			<div class="content np">

				<!-- <table cellpadding="0" cellspacing="0" width="100%"> -->
				<table>
				
						<thead id="float-element">
						<tr>
							<th><div class="details">Details</div></th>
							<th><div class="details">Intitule</div></th>
							<th><div class="details">Descritpion</div></th>
							<th><div class="details">Etat</div></th>
							<th><div class="details">Autorisation</div></th>
							<th><div class="details">Nom demandeur</div></th>
							<th><div class="details">Service executant</div></th>
							<th><div class="details">Elu</div></th>
							<th><div class="details">Date demande travaux</div></th>
							<th><div class="details">Nom du technicien</div></th>
							<th><div class="details">Nom batiment</div></th>
							<th><div class="details">Ref. cadastrale</div></th>
							<th><div class="details">Ap existant</div>e</th>
							<th><div class="details">Complement AP</div></th>
							<th><div class="details">Autorisation a creer</div></th>
							<th><div class="details">Observation Operation</div></th>
							<th><div class="details">Observation batiment</div></th>

						</tr>
					</thead>
					<tbody>

						<c:forEach items="${listeOperation}" var="op">
							<tr>
								<td><div class="details">

										<p>
											<a
												href="<c:url value="/private/modifieOperation"><c:param name="id" value="${op.id}"/>Libelle</c:url>">
												Acces libelle </a>
										</p>
										
										<p>
											<a
												href="<c:url value="/private/listePhase"><c:param name="id" value="${op.id}"/></c:url>">
												Acces calendrier </a>
										</p>
										<p>
											<a
												href="<c:url value="/private/afficheBudget"><c:param name="id" value="${op.id}"/></c:url>">Acces
												budget </a>
										</p>
										<p>
											<a
												href="<c:url value="/private/listeMessage"><c:param name="id" value="${op.id}"/></c:url>">
												Acces historique </a>
										</p>
									</div> <%-- Faire en vertical ? en carré ? --%></td>

								<td><div class="details">
										<a
											href="<c:url value="/private/afficheOperation"/>?id=${op.id}">
											${op.libelle.intitule} </a>
									</div></td>
								<td><div class="details">${op.libelle.description}</div></td>
								<td><div class="details">${op.libelle.etat}</div></td>
								<td><div class="details">${op.libelle.autorisation}</div></td>
								<td><div class="details">${op.libelle.nomDemandeurOperation}</div></td>
								<td><div class="details">${op.libelle.nomServiceExecutant}</div></td>
								<td><div class="details">${op.libelle.nomElu}</div></td>
								<td><div class="details">${op.libelle.dateDemandeTravaux}</div></td>
								<td><div class="details">${op.libelle.nomTechnicien}</div></td>
								<td><div class="details">${op.libelle.nomBatiment}</div></td>
								<td><div class="details">${op.libelle.refCadastralBatiment}</div></td>
								<td><div class="details">${op.libelle.APexistante}</div></td>
								<td><div class="details">${op.libelle.complementAP}</div></td>
								<td><div class="details">${op.libelle.autorisationACreer}</div></td>
								<td><div class="details">${op.libelle.observationsOperation}</div></td>
								<td><div class="details">${op.libelle.observationBatiment}</div></td>
							</tr>
						</c:forEach>

					</tbody>
				</table>

			</div>
		</div>
	</div>
</div>

<c:import url="/inc/content-end.jsp" />
<c:import url="/inc/footer.jsp" />
